import React from 'react';
import './App.css';
import { BrowserRouter as Router, NavLink, Route, Redirect } from 'react-router-dom'

import Register from './views/Register'
import Login from './views/login'
import Forget from './views/Forget'
import Home from './views/Home'
import Vipcen from './views/Vipcen'
import Item from './views/Item'
import Center from './views/Center'
import Homepage from './views/Homepage';

export default class App extends React.Component {
    constructor(props) {
        super(props)
    }
    render() {
        return (
            <Router>
                <div>
                  
                    <Route path="/register" component={Register}></Route>
                    <Route path="/login" component={Login}></Route>
                    <Route path='/forget' component={Forget}></Route>

                    <Route  path="/item/:pid" component={Item} ></Route>
                    <Route path='/home' render={() =>
                        <Redirect to={'/homepage'}  ></Redirect>
                    } ></Route>


                    <Route  path='/homepage' render={() =>
                        <Redirect to={'/home/homepage'}></Redirect>
                    } component={Home}></Route>

                    <Route exact path='/product' render={() =>
                        <Redirect to={'/home/product'}></Redirect>
                    } component={Home}></Route>
                    <Route exact path='/boy' render={() =>
                        <Redirect to={'/home/boy'}></Redirect>
                    } component={Home}></Route>
                    <Route exact path='/girl' render={() =>
                        <Redirect to={'/home/girl'}></Redirect>
                    } component={Home}></Route>
                    <Route exact path='/smart' render={() =>
                        <Redirect to={'/home/smart'}></Redirect>
                    } component={Home}></Route>
                    <Route exact path='/musical' render={() =>
                        <Redirect to={'/home/musical'}></Redirect>
                    } component={Home}></Route>

                    <Route path="/vipcen" render={() =>
                        <Redirect to={'/center'}></Redirect>
                    } ></Route>

                    <Route path='/center' render={() =>
                        <Redirect to={'/vipcen/center'}></Redirect>
                    } component={Vipcen}></Route>
                    <Route path='/vipmessage' render={() =>
                        <Redirect to={'/vipcen/vipmessage'}></Redirect>
                    } component={Vipcen}></Route>
                    <Route path='/mycoupon' render={() =>
                        <Redirect to={'/vipcen/mycoupon'}></Redirect>
                    } component={Vipcen}></Route>
                    <Route path='/address' render={() =>
                        <Redirect to={'/vipcen/address'}></Redirect>
                    } component={Vipcen}></Route>
                    <Route path='/myfavorite' render={() =>
                        <Redirect to={'/vipcen/myfavorite'}></Redirect>
                    } component={Vipcen}></Route>
                    <Route path='/myorder' render={() =>
                        <Redirect to={'/vipcen/myorder'}></Redirect>
                    } component={Vipcen}></Route>

                    <Route path='/cart' render={() =>
                        <Redirect to={'/vipcen/cart'}></Redirect>
                    } component={Vipcen}></Route>
                    
                    <Route path='/orderdetail' render={() =>
                        <Redirect to={'/vipcen/orderdetail'}></Redirect>
                    } component={Vipcen}></Route>
                      <Route exact path="/" render={() =>
                        <Redirect to={'/home'}></Redirect>} >
                    </Route>
                 
                </div>
            </Router>
        )
    }
}


